package com.chzc.fm.duotin.ui.home.utils;

/**
 * Created by Administrator on 2016/7/5.
 */
public class NumberTimeUtils {

    public static String parseMillToXiaoShi(long distance){

        String target = "0";


        if (distance>0){
            double number =(double)distance;
            double minute = number / 1000;//求相差多少分钟
            if (minute<60){
                long minutes = (long) minute;
                target = ""+minutes+" 分钟";
            }else if(minute>=60){
                double hours = minute/60;//取整数
                //判断是否相隔时间大于一天
                if (hours<24){

                    long hour = (long) hours;
                    target = ""+hour+" 小时";
                }else{
                    //如果大于一天
                    double day = hours/24;
                    long days = (long) day;//取整
                    target = ""+days+"天";

                }
            }
        }


        return target;
    }

}
